/**
 * User: alesj
 * Date: 2004.8.11
 * Time: 15:09:39
 */

package com.generalynx.ecos.data;

import java.io.Serializable;


/**
 * @hibernate.class table="eusererole"
 */
public class UserRole implements Serializable {

    private static final long serialVersionUID = 1L;

    private int m_id;
    private int m_userId;
    private int m_roleId;
    private String m_username;
    private String m_rolename;

    public boolean equals(Object obj) {
        UserRole ur = (UserRole)obj;
        return (getUserId() == ur.getUserId() && getRoleId() == ur.getRoleId());
    }

    public int hashCode() {
        return (getUsername() + getRolename()).hashCode();
    }

    /**
     * @hibernate.id column="eusererole_id" unsaved-value="0" generator-class="native"
     */
    public int getId() {
        return m_id;
    }

    public void setId(int id) {
        m_id = id;
    }

    /**
     * @hibernate.property column="euser_id"
     */
    public int getUserId() {
        return m_userId;
    }

    public void setUserId(int userId) {
        m_userId = userId;
    }

    /**
     * @hibernate.property column="erole_id"
     */
    public int getRoleId() {
        return m_roleId;
    }

    public void setRoleId(int roleId) {
        m_roleId = roleId;
    }

    /**
     * @hibernate.property
     */
    public String getUsername() {
        return m_username;
    }

    public void setUsername(String username) {
        m_username = username;
    }

    /**
     * @hibernate.property
     */
    public String getRolename() {
        return m_rolename;
    }

    public void setRolename(String rolename) {
        m_rolename = rolename;
    }

}
